/*
 * Copyright (c) 2016. zhaojin 15398699939@163.com
 */

package com.bankscene.screenfit.vus;

import android.graphics.drawable.Drawable;
import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import com.bankscene.screenfit.R;

import org.greenrobot.eventbus.EventBus;

import butterknife.BindDrawable;
import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by jiiiiiin
 */
public class MainVu extends BaseVu {

    @BindView(R.id.toolbar)
    Toolbar toolbar;
    @BindDrawable(R.drawable.logo_white)
    Drawable logo;

    @Override
    public void init(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable EventBus bus) {
        this.bus = bus;
        rootView = inflater.inflate(R.layout.main_activity, container, false);
        unbinder = ButterKnife.bind(this, rootView);
        toolbar.setLogo(logo);
//如果需要设置居中显示的Title
//        TextView tv= new TextView(inflater.getContext());
//        tv.setText("Title");
//        Toolbar.LayoutParams params = new Toolbar.LayoutParams(
//                Toolbar.LayoutParams.WRAP_CONTENT,
//                Toolbar.LayoutParams.WRAP_CONTENT,
//                Gravity.CENTER);
//        tv.setLayoutParams(params);
//        toolbar.addView(tv);
    }

    @CheckResult
    public Toolbar getActionBar() {
        return toolbar;
    }

}
